package com.heima.common.exception.config;

import com.heima.model.common.enums.AppHttpCodeEnum;

/**
 * @Description:
 * @Version: V1.0
 */
public class CustomException extends  RuntimeException {

    // 错误代码实体
    private AppHttpCodeEnum appHttpCodeEnum;

    public CustomException(AppHttpCodeEnum appHttpCodeEnum) {
        this.appHttpCodeEnum = appHttpCodeEnum;
    }

    public CustomException(AppHttpCodeEnum appHttpCodeEnum, String errorMessage) {
        appHttpCodeEnum.setErrorMessage(errorMessage);
        this.appHttpCodeEnum = appHttpCodeEnum;
    }

    public AppHttpCodeEnum getAppHttpCodeEnum() {
        return appHttpCodeEnum;
    }
}
